package com.shujia.homework.exer2;

public class Car {
    private String type;
    private String carNo;


    public void start() {
        System.out.println("我是车，我启动");
    }

    public void stop() {
        System.out.println("我是车，我停止");
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCarNo() {
        return carNo;
    }

    public void setCarNo(String carNo) {
        this.carNo = carNo;
    }
}


class FamilyCar extends Car {
    private String owner;

    public FamilyCar(String owner) {
        this.owner = owner;
    }

    public void start() {
        System.out.println("我是" + owner + ",我的汽车我做主");

    }

    public void stop() {
        System.out.println("目的地到了，我们去玩吧");
    }

}

class TaxiCar extends Car {
    private String company;

    public TaxiCar(String company) {
        this.company = company;
    }

    public void start() {
        System.out.println("乘客您好\n我是" + this.company + "的,我的车牌号是" + this.getCarNo() + ",你要去哪里?");

    }

    public void stop() {
        System.out.println("目的地已经到了，请您下车付款，欢迎再次乘坐");
    }
}